/**
 * 给定矩阵判断是否满足条件
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

template <typename T>
const T & mymax(const T & a, const T & b){
    return max(a, b);
}

template<typename T, typename ... Args>
const T & mymax(const T & t, const Args & ... args){
    return max(t, mymax(args ...));
}

template<typename T>
void input(vector<T> & v, int n){
	v.assign(n + 1, {});
    for(int i=1;i<=n;++i) cin >> v[i];
	return;
}

template<typename T>
istream & operator >> (istream & is, vector<T> & v){
	for(auto & i : v) is >> i;
	return is;
}

using llt = long long;
using vi = vector<int>;
using vll = vector<llt>;
using pii = pair<int, int>;
using vpii =vector<pii>;

llt const INF = 0x3F4F5F6F7F8F9FAF;

vector<vi> vec;
int n, m; int x;

bool proc(){
    llt ans = 0;
    for(const auto & a : vec){
        ans += accumulate(a.begin(), a.end(), 0LL);
    }
    if(ans != x) return false;

    int target = 0;
    for(auto i : vec[0]) target ^= i;

    for(const auto & a : vec){
        int t = 0;
        for(auto i : a) t ^= i;
        if(t != target) return false;
    }

    for(int i=0;i<m;++i){
        int t = 0;
        for(int j=0;j<n;++j) t ^= vec[j][i];
        if(t != target) return false;
    }

    return true;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);   

    cin >> n >> m >> x;
    vec.assign(n, vi(m, 0));
    for(auto & a : vec)for(auto & i : a)cin>>i;
    cout << (proc() ? "accepted" : "wrong answer") << endl;
    return 0;
}